import mysql.connector

class DbConn:
    def __init__(self):
        self.conn = self.conn()


    def conn(self,host,username,passwd,databse):
        myconn = mysql.connector.connect(
            host=host,  # 数据库主机地址
            user=username,  # 数据库用户名
            passwd=passwd,  # 数据库密码
            database = "databse"
        )
        return myconn


    def close(self):
        self.conn.close()

if __name__ == '__main__':
    pass